D) type_trait conditional & enable

std::conditional
template <bool B, class T, class F>
struct conditional;
// helper type
template <bool B, class T, class F>
using conditional_t=typename conditional<B, T, F>:::type;
// possible implementation
template <bool B, class T, class F>
struct conditional{ typedef T type; };
template <class T, class F>
struct conditional<false, T, F>{ typedef F type; };
ex)
#include <iostream>
#include <type_traits>
#include <typeinfo>
int main(void){
typedef std::conditional<true, int, double>::type Type1;
typedef std::conditional<false, int, double>::type Type2;
typedef std::conditional<sizeof(int)>=sizeof(double), int, double>::type Type3;
std::cout<<typeid(Type1).name()<<'\n';
std::cout<<typeid(Type2).name()<<'\n';
std::cout<<typeid(Type3).name()<<'\n';
}
std::enable_if
template <bool B, class T=void>
struct enable_if;
// helper type
template <bool B, class T=void>
using enable_if_t=typename enable_if<B, T>::type;
// possible implementation
template <bool B, class T=void>
struct enable_if{};
template <class T>
struct enable_if<true, T>{ typedef T type; };